Unit 4 Exercise 2
Exercise 2: Thresholds
Objective
To use a Threshold to trigger a job to run and use Notifications to let you know that the threshold is incrementing and decrementing.
Summary
Utilizing a Threshold called TrainingThreshold to prevent a job from running until its has reached a value of 2. You will also configure some $NOTIFY:EMAIL events to alert you of the initial value, updated value and final value of the Threshold.
Instructions
Create the Threshold
- In Library > Administration, select Thresholds.
- Click Add.
- In the Thresholds pop-up:
- In the Name field, enter
TrainingThreshold
. - In the Value field, enter a value of
0
. - In the Description field, enter in some documentation.
- Click the Save button.
- Click Back.
Create the Schedule
- In Library > Administration, select Master Schedule.
- Click Add button.
- On the Master Schedule Definition screen:
- In the Schedule Name field, enter
My Threshold Schedule
. - Add Documentation
- Monday - Sunday are working days.
- Do NOT use the Master Holiday Calendar.
- Auto Build
7
days in advance for1
days. - Auto Delete
7
days ago.
Create the Jobs
- In Studio, select My Threshold Schedule and click View.
- In the side menu, select Add Job.
- In the Master Job Definition screen:
- In the Name field, enter
Threshold Dependency Job
. - In the Job Type drop down, select Windows.
- In the Machine drop down, select SMATRAINING.
- In the User ID drop down, select SMATRAINING\SMAUSER
- In the Command Line field, enter
"C:\Program Files\OpConxps\MSLSAM\genericp.exe" -t10
. Remember to use properties where acceptable. - Add Documentation.
- In the Frequency section, move the Mon-Sun-O frequency into the Active column.
- Click Back to get back to the Studio.
- Utilizing the Copy function, copy Threshold Dependency Job to add a second job called, Threshold Update Job.
Create Threshold Dependencies and Updates
- In Studio, select the Threshold Dependency Job.
- In the side menu, select Add Threshold Dependency.
- In the Threshold pop-up window:
- In the Threshold drop down, select TrainingThreshold.
- In the Operator drop down, select =.
- In the Value field, enter
2
. - Click Save.
- In Studio, select the Threshold Dependency Job.
- In the side menu, select Add Threshold Update.
- In the Threshold pop-up window:
- In the Threshold drop down, select TrainingThreshold.
- In the Job Status drop down, select Finish OK.
- In the Value field, enter
0
. - Click Save.
- Click Back.
- In Studio, select the Threshold Update Job.
- In the side menu, select Add Threshold Update.
- In the Threshold pop-up window:
- In the Threshold drop down, select TrainingThreshold.
- In the Job Status drop down, select Finish OK.
- In the Value field, enter
2
. - Click Save.
Create NULL Jobs and Define the Notify Events
- In the side menu in Studio, select Add Job
- On the Master Job Definition screen:
- In the Name field, enter
Initial Value Notification
. - In the Job Type field, leave it as Null Job.
- Add Documentation.
- In the Frequency section, move the Mon-Sun-O frequency into the Active column.
- Click Save.
- Click Back to get back to the Studio.
- Utilizing the Copy function, copy the Initial Value Notification job to create 2 more jobs. One called, After Update Job and the other called Final Value Job.
- Select the Initial Value Notification, click the Wrench icon and enter Admin Mode.
- In the Event section, click +
- In the Event pop-up window:
- In the Send Event On dropdown, select Job Status.
- In the Job Status dropdown, select Finished OK.
- In the Event Template dropdown, select
$NOTIFY:EMAIL
and update the Events parameters as follows:- In the To, enter
smauser@congo.local
. - In the Subject, enter
Initial value of TrainingThreshold
- In the Message, enter
Initial value of TrainingThreshold is [[TH.TrainingThreshold]]
- In the To, enter
- Click the Save button.
- Click the Save button in Master Job Definition.
- Click Back
- Select the After Update Job, click the Wrench icon and enter Admin Mode.
- In the Event section, click +
- In the Event pop-up window:
- In the Send Event On dropdown, select Job Status.
- In the Job Status dropdown, select Finished OK.
- In the Event Template dropdown, select
$NOTIFY:EMAIL
and update the Events parameters as follows:- In the To, enter
smauser@congo.local
. - In the Subject, enter
After the Update
- In the Message, enter
After the update the value of TrainingThreshold is [[TH.TrainingThreshold]]
- In the To, enter
- Click the Save button.
- Click the Save button in Master Job Definition.
- Click Back
- Select the Final Value Job, click the Wrench icon and enter Admin Mode.
- In the Event section, click +
- In the Event pop-up window:
- In the Send Event On dropdown, select Job Status.
- In the Job Status dropdown, select Finished OK.
- In the Event Template dropdown, select
$NOTIFY:EMAIL
and update the Events parameters as follows:- In the To, enter
smauser@congo.local
. - In the Subject, enter
Final value of TrainingThreshold
- In the Message, enter
Final value of TrainingThreshold is [[TH.TrainingThreshold]]
- In the To, enter
- Click the Save button.
- Click the Save button in Master Job Definition.
- Click Back
Add Job Dependencies
- Select the Final Value Job, click Add Dependency in the side menu.
- In the Job Dependency pop-up window, select Threshold Dependency Job.
- Click Save.
- Select the After Update Job, click Add Dependency in the side menu.
- In the Job Dependency pop-up window, select Threshold Update Job.
- Click Save.
- Select the Threshold Update Job, click Add Dependency in the side menu.
- In the Job Dependency pop-up window, select Initial Value Notification.
- Click Save.
Once all the dependencies and events have been configured, your workflow should look something like this:
Build the Schedule
- In Operations, build the Schedule Released for today.
- Be sure the My Threshold Schedule is Completed.
- Open Thunderbird and check the inbox.
- You should find
3
new emails. Open the emails and check the contents.
Enterprise Manager
Details
Create the Threshold.
- Under the Administration topic, Double-Click on Thresholds.
- Click the Add button on the Thresholds toolbar.
- In the Name textbox, type TrainingThreshold, type some documentation and in the Threshold textbox enter a value of
0
. - Click the Save button on the Thresholds toolbar. Close the Thresholds tab.
Create the Schedule and Jobs.
- Under the Administration topic, Double-Click Schedule Master.
- Click the Add button on the Schedule Master toolbar.
- Add a new Schedule called My Threshold Schedule.
- Use these settings for the Schedule:
- Monday through Sunday are working days.
- Do NOT use the Master Holiday Calendar.
- Auto Build
7
days in advance for1
days. - Auto Delete
7
days ago.
- Do not forget to add Documentation to your Schedule.
- Close the Schedule Master and open the Job Master to add your Jobs.
- Select the My Threshold Schedule.
- Click the Add button on the Job Master toolbar.
- Add a new Job named Threshold Dependency Job have it run the following:
- Program:
Genericp.exe
program to run for10
seconds.noteIf using Ctrl+F, do not select a command line that is using a Schedule or Job Instance Property
- Machine:
SMATraining
- Machine:
- User:
SMATRAINING\SMAUSER
- Frequency:
Example-Mon-Sun-O
- Also do not forget to add Documentation.
- Program:
Create the Threshold Dependency.
- Click on the Dependencies tab.
- Click on the Threshold/Resource Dependency tab.
- In the Threshold/Resource Dependency frame, click the Add button.
- In the Threshold/Resource drop-down list, select TrainingThreshold.
- In the Operator drop-down list, select
=
(equals symbol). - In the Value textbox, type
2
. - Click the OK button.
Create a Threshold/Resource Update:
- Click on the Threshold/Resource Update tab.
- In the Threshold/Resource Update frame, click the Add button.
- Select TrainingThreshold from the drop-down list.
- In the Job Status drop-down list, select Finished OK.
- In the Value textbox, type
0
. - Click OK.
Click the Add button on the Job Master toolbar to add another Job.
Name the Job as Threshold Update Job.
- Program:
Genericp.exe
program to run for10
seconds - Machine:
SMATraining
- User:
SMATRAINING\SMAUSER
- Frequency:
Example-Mon-Sun-O
- Also do not forget to add Documentation.
- Program:
Create a Threshold/Resource Update:
- Click on the Threshold/Resource Update tab.
- In the Threshold/Resource Update frame, click the Add button.
- Select TrainingThreshold from the drop-down list.
- In the Job Status drop-down list, select Finished OK.
- In the Value textbox, type
2
.
Add a Null Job to the Schedule to send a notification with the initial value of the Threshold.
Click the Add button on the Job Master toolbar.
Name the Job as Threshold Initial Value Job and
Frequency: Mon-Sun-O
Click the Events tab and click the Add button in the Events frame.
Select the Job Status radio button.
Click Next.
Select Finished OK from the Job Status drop-down list.
Click Next.
Select the
$NOTIFY:EMAIL
Event from the Event Template drop-down list.Update the Events parameters as follows:
smauser@congo.local,,,Initial value of TrainingThreshold,Initial value of TrainingThreshold is [[TH.TrainingThreshold]]
Click Finish.
Add a second Null Job to the Schedule to send a notification with the value of the Threshold after it is updated to
2
.- Be sure you have the Threshold Initial Value Job selected.
- Click the Copy button (fourth button from the right) on the Job Master toolbar to copy this Job.
- Name the new Job as Threshold After Update Job.
- Go to the Events tab and change the Event to the following:
smauser@congo.local,,,After the update,After the update the value of TrainingThreshold is [[TH.TrainingThreshold]]
Add a third Null Job to the Schedule to send a notification with the final value of the Threshold.
- Be sure you have the Threshold After Update Job selected.
- Click the Copy button (fourth button from the right) on the Job Master toolbar to copy this Job.
- Name the new Job as Threshold Final Value Job.
- Go to the Events tab and change the Event to the following:
smauser@congo.local,,,Final value of TrainingThreshold,Final value of TrainingThreshold is [[TH.TrainingThreshold]]
Close the Job Master and the Schedule Master (if open).
Open Workflow Designer to set Dependencies.
- Select the My Threshold Schedule from the Select Schedule frame.
- Build the Schedule Released for today.
- Open one of the operations views (List or Matrix) or use Solution Manager.
- Be sure the My Threshold Schedule is Completed.
- Open Thunderbird and check the inbox.
- You should find
3
new emails. Open the emails and check the contents.